<div class="sub-page">
    <h2>Welcome: <span class="red-text"><?php echo Yii::app()->user->name;?></span></h2>
    <div class="all-product">
        <div class="contact">
            <div class="ct-title">Account information</div>
            <div class="form-style marT20">
                <p>
                    <label>First Name:</label>
                    <span class="right-label gray-text"><?php echo $model['street'] ? $model['street'] : "Please update first name";?></span>
                </p>
                <p>
                    <label>Last Name:</label>
                    <span class="right-label gray-text"><?php echo $model['street'] ? $model['street'] : "Please update last name";?></span>
                </p>
                <p>
                    <label>Email:</label>
                    <span class="right-label"><?php echo Yii::app()->user->name;?></span>
                </p>
                <p>
                    <label>Password:</label>
                    <span class="right-label">******</span>
                </p>
                <p>
                    <label>Address:</label>
                    <span class="right-label gray-text"><?php echo $model['street'] ? $model['street'] : "Please update address";?></span>
                </p>
                <p>
                    <label>Town / City:</label>
                    <span class="right-label gray-text"><?php echo $model['city'] ? $model['city'] : "Please update town/city";?></span>
                </p>
                <p>
                    <label>State:</label>
                    <span class="right-label gray-text"><?php echo $model['state'] ? $model['state'] : "Please update state";?></span>
                </p>
                <p>
                    <label>Zip:</label>
                    <span class="right-label gray-text"><?php echo $model['zipcode'] ? $model['zipcode'] : "Please update zip code";?></span>
                </p>
                <p>
                    <label>Phone:</label>
                    <span class="right-label"><?php echo $model['street'] ? $model['phone'] : "Please update phone";?></span>
                </p>
                <p>
                    <label>&nbsp;</label>
                    <a class="red-button" href="#">Edit</a>
                </p>
            </div>
        </div>
        <div class="contact">
            <div class="ct-title">Latest order</div>
            <table class="tb-style">
                <tr>
                    <th>No.</th>
                    <th>Picture</th>
                    <th>Item name</th>
                    <th>Quantity</th>
                    <th>Unit</th>
                    <th>Total</th>
                    <th>Option</th>
                </tr>
                <?php if($cart):
                    $product = $cart[count($cart) - 1];
                if (@$model = Products::model()->findByPk($product['product_id'])):
                    $variations = '';
                    if (isset($product['frame-included'])):
                        // Check frame included
                        $variations = 1;
                    endif;
                ?>
                <tr>
                    <td align="center" valign="top" width="6%">01</td>
                    <td align="center" width="10%"><img src="<?php echo Yii::app()->request->baseUrl ?>/data/images/img-products/img-product03.png" width="50" height="50"></td>
                    <td><a href="<?php echo $this->createUrl('/shop/products/view', array('id'=>$product['product_id']))?>"><?php echo $model['title'] ?></a></td>
                    <td align="center" valign="top" width="15%">
                        <input rel="<?php echo count($cart)-1;?>" class="amount" style="width:60px" name="" placeholder="<?php echo $product['amount']?>" type="text">
                    </td>
                    <td align="left" valign="top" width="15%">
                        <h3 rel="<?php echo Shop::priceFormat($model->getPrice(@$variations)); ?>" class="<?php echo 'price_'.(count($cart)-1);?>">
                        $<?php echo Shop::priceFormat(@$model->getPrice(@$variations)); ?>
                        </h3>
                    </td>
                    <td align="left" valign="top" width="15%">
                        <h2 class="<?php echo 'total_price_'.(count($cart)-1);?>">
                            $<?php echo Shop::priceFormat($model->getPrice(@$variations, @$product['amount'])); ?>
                        </h2>
                    </td>
                    <td valign="top" width="10%"><a class="red-button" href="/shop/shoppingCart/view">Re-Order</a></td>
                </tr>
                <?php endif;
                endif;?>
            </table>
        </div>
    </div>

    <div class="sub-total">
        Sub-Total: <span class="price_total">$<?php echo Shop::getPriceTotal() ?></span>
    </div>
    <div>
        <a class="black-button marT20" style="margin-right:15px" href="/shop/products/all">Back to shopping</a>
        <a class="red-button marT20" href="/shop/order/create">Go to checkout</a>
    </div>
</div>

</div>